# coding: utf-8

"""
    Firefly III API Client

    This is the Python client for Firefly III API  # noqa: E501

    The version of the OpenAPI document: 0.10.0
    Contact: thegrumpydictator@gmail.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class TransactionSplitUpdate(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'amount': 'float',
        'budget_id': 'int',
        'budget_name': 'str',
        'category_id': 'int',
        'category_name': 'str',
        'currency_code': 'str',
        'currency_id': 'int',
        'description': 'str',
        'destination_id': 'int',
        'destination_name': 'str',
        'foreign_amount': 'float',
        'foreign_currency_code': 'str',
        'foreign_currency_id': 'int',
        'reconciled': 'bool',
        'source_id': 'int',
        'source_name': 'str'
    }

    attribute_map = {
        'amount': 'amount',
        'budget_id': 'budget_id',
        'budget_name': 'budget_name',
        'category_id': 'category_id',
        'category_name': 'category_name',
        'currency_code': 'currency_code',
        'currency_id': 'currency_id',
        'description': 'description',
        'destination_id': 'destination_id',
        'destination_name': 'destination_name',
        'foreign_amount': 'foreign_amount',
        'foreign_currency_code': 'foreign_currency_code',
        'foreign_currency_id': 'foreign_currency_id',
        'reconciled': 'reconciled',
        'source_id': 'source_id',
        'source_name': 'source_name'
    }

    def __init__(self, amount=None, budget_id=None, budget_name=None, category_id=None, category_name=None, currency_code=None, currency_id=None, description=None, destination_id=None, destination_name=None, foreign_amount=None, foreign_currency_code=None, foreign_currency_id=None, reconciled=None, source_id=None, source_name=None):  # noqa: E501
        """TransactionSplitUpdate - a model defined in OpenAPI"""  # noqa: E501

        self._amount = None
        self._budget_id = None
        self._budget_name = None
        self._category_id = None
        self._category_name = None
        self._currency_code = None
        self._currency_id = None
        self._description = None
        self._destination_id = None
        self._destination_name = None
        self._foreign_amount = None
        self._foreign_currency_code = None
        self._foreign_currency_id = None
        self._reconciled = None
        self._source_id = None
        self._source_name = None
        self.discriminator = None

        self.amount = amount
        if budget_id is not None:
            self.budget_id = budget_id
        if budget_name is not None:
            self.budget_name = budget_name
        if category_id is not None:
            self.category_id = category_id
        if category_name is not None:
            self.category_name = category_name
        if currency_code is not None:
            self.currency_code = currency_code
        if currency_id is not None:
            self.currency_id = currency_id
        if description is not None:
            self.description = description
        if destination_id is not None:
            self.destination_id = destination_id
        if destination_name is not None:
            self.destination_name = destination_name
        if foreign_amount is not None:
            self.foreign_amount = foreign_amount
        if foreign_currency_code is not None:
            self.foreign_currency_code = foreign_currency_code
        if foreign_currency_id is not None:
            self.foreign_currency_id = foreign_currency_id
        if reconciled is not None:
            self.reconciled = reconciled
        self.source_id = source_id
        if source_name is not None:
            self.source_name = source_name

    @property
    def amount(self):
        """Gets the amount of this TransactionSplitUpdate.  # noqa: E501

        Amount of the transaction.  # noqa: E501

        :return: The amount of this TransactionSplitUpdate.  # noqa: E501
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this TransactionSplitUpdate.

        Amount of the transaction.  # noqa: E501

        :param amount: The amount of this TransactionSplitUpdate.  # noqa: E501
        :type: float
        """
        if amount is None:
            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501

        self._amount = amount

    @property
    def budget_id(self):
        """Gets the budget_id of this TransactionSplitUpdate.  # noqa: E501

        The budget ID for this transaction.  # noqa: E501

        :return: The budget_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._budget_id

    @budget_id.setter
    def budget_id(self, budget_id):
        """Sets the budget_id of this TransactionSplitUpdate.

        The budget ID for this transaction.  # noqa: E501

        :param budget_id: The budget_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """

        self._budget_id = budget_id

    @property
    def budget_name(self):
        """Gets the budget_name of this TransactionSplitUpdate.  # noqa: E501

        The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored.  # noqa: E501

        :return: The budget_name of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._budget_name

    @budget_name.setter
    def budget_name(self, budget_name):
        """Sets the budget_name of this TransactionSplitUpdate.

        The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored.  # noqa: E501

        :param budget_name: The budget_name of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._budget_name = budget_name

    @property
    def category_id(self):
        """Gets the category_id of this TransactionSplitUpdate.  # noqa: E501

        The category ID for this transaction.  # noqa: E501

        :return: The category_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._category_id

    @category_id.setter
    def category_id(self, category_id):
        """Sets the category_id of this TransactionSplitUpdate.

        The category ID for this transaction.  # noqa: E501

        :param category_id: The category_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """

        self._category_id = category_id

    @property
    def category_name(self):
        """Gets the category_name of this TransactionSplitUpdate.  # noqa: E501

        The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name.  # noqa: E501

        :return: The category_name of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._category_name

    @category_name.setter
    def category_name(self, category_name):
        """Sets the category_name of this TransactionSplitUpdate.

        The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name.  # noqa: E501

        :param category_name: The category_name of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._category_name = category_name

    @property
    def currency_code(self):
        """Gets the currency_code of this TransactionSplitUpdate.  # noqa: E501

        Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id.  # noqa: E501

        :return: The currency_code of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._currency_code

    @currency_code.setter
    def currency_code(self, currency_code):
        """Sets the currency_code of this TransactionSplitUpdate.

        Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id.  # noqa: E501

        :param currency_code: The currency_code of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._currency_code = currency_code

    @property
    def currency_id(self):
        """Gets the currency_id of this TransactionSplitUpdate.  # noqa: E501

        Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code.  # noqa: E501

        :return: The currency_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._currency_id

    @currency_id.setter
    def currency_id(self, currency_id):
        """Sets the currency_id of this TransactionSplitUpdate.

        Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code.  # noqa: E501

        :param currency_id: The currency_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """

        self._currency_id = currency_id

    @property
    def description(self):
        """Gets the description of this TransactionSplitUpdate.  # noqa: E501

        Description of the transaction. Will only be used if more than one split is submitted.  # noqa: E501

        :return: The description of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this TransactionSplitUpdate.

        Description of the transaction. Will only be used if more than one split is submitted.  # noqa: E501

        :param description: The description of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._description = description

    @property
    def destination_id(self):
        """Gets the destination_id of this TransactionSplitUpdate.  # noqa: E501

        ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account.  # noqa: E501

        :return: The destination_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._destination_id

    @destination_id.setter
    def destination_id(self, destination_id):
        """Sets the destination_id of this TransactionSplitUpdate.

        ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account.  # noqa: E501

        :param destination_id: The destination_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """

        self._destination_id = destination_id

    @property
    def destination_name(self):
        """Gets the destination_name of this TransactionSplitUpdate.  # noqa: E501

        Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough.  # noqa: E501

        :return: The destination_name of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._destination_name

    @destination_name.setter
    def destination_name(self, destination_name):
        """Sets the destination_name of this TransactionSplitUpdate.

        Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough.  # noqa: E501

        :param destination_name: The destination_name of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._destination_name = destination_name

    @property
    def foreign_amount(self):
        """Gets the foreign_amount of this TransactionSplitUpdate.  # noqa: E501

        The amount in a foreign currency.  # noqa: E501

        :return: The foreign_amount of this TransactionSplitUpdate.  # noqa: E501
        :rtype: float
        """
        return self._foreign_amount

    @foreign_amount.setter
    def foreign_amount(self, foreign_amount):
        """Sets the foreign_amount of this TransactionSplitUpdate.

        The amount in a foreign currency.  # noqa: E501

        :param foreign_amount: The foreign_amount of this TransactionSplitUpdate.  # noqa: E501
        :type: float
        """

        self._foreign_amount = foreign_amount

    @property
    def foreign_currency_code(self):
        """Gets the foreign_currency_code of this TransactionSplitUpdate.  # noqa: E501

        Currency code. Default is NULL. Can be used instead of the foreign_currency_id, but either is required when submitting a foreign amount.  # noqa: E501

        :return: The foreign_currency_code of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._foreign_currency_code

    @foreign_currency_code.setter
    def foreign_currency_code(self, foreign_currency_code):
        """Sets the foreign_currency_code of this TransactionSplitUpdate.

        Currency code. Default is NULL. Can be used instead of the foreign_currency_id, but either is required when submitting a foreign amount.  # noqa: E501

        :param foreign_currency_code: The foreign_currency_code of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._foreign_currency_code = foreign_currency_code

    @property
    def foreign_currency_id(self):
        """Gets the foreign_currency_id of this TransactionSplitUpdate.  # noqa: E501

        Currency ID. Default is null. Is required when you submit a foreign amount.  # noqa: E501

        :return: The foreign_currency_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._foreign_currency_id

    @foreign_currency_id.setter
    def foreign_currency_id(self, foreign_currency_id):
        """Sets the foreign_currency_id of this TransactionSplitUpdate.

        Currency ID. Default is null. Is required when you submit a foreign amount.  # noqa: E501

        :param foreign_currency_id: The foreign_currency_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """

        self._foreign_currency_id = foreign_currency_id

    @property
    def reconciled(self):
        """Gets the reconciled of this TransactionSplitUpdate.  # noqa: E501

        If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user.  # noqa: E501

        :return: The reconciled of this TransactionSplitUpdate.  # noqa: E501
        :rtype: bool
        """
        return self._reconciled

    @reconciled.setter
    def reconciled(self, reconciled):
        """Sets the reconciled of this TransactionSplitUpdate.

        If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user.  # noqa: E501

        :param reconciled: The reconciled of this TransactionSplitUpdate.  # noqa: E501
        :type: bool
        """

        self._reconciled = reconciled

    @property
    def source_id(self):
        """Gets the source_id of this TransactionSplitUpdate.  # noqa: E501

        ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account.  # noqa: E501

        :return: The source_id of this TransactionSplitUpdate.  # noqa: E501
        :rtype: int
        """
        return self._source_id

    @source_id.setter
    def source_id(self, source_id):
        """Sets the source_id of this TransactionSplitUpdate.

        ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account.  # noqa: E501

        :param source_id: The source_id of this TransactionSplitUpdate.  # noqa: E501
        :type: int
        """
        if source_id is None:
            raise ValueError("Invalid value for `source_id`, must not be `None`")  # noqa: E501

        self._source_id = source_id

    @property
    def source_name(self):
        """Gets the source_name of this TransactionSplitUpdate.  # noqa: E501

        Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name.  # noqa: E501

        :return: The source_name of this TransactionSplitUpdate.  # noqa: E501
        :rtype: str
        """
        return self._source_name

    @source_name.setter
    def source_name(self, source_name):
        """Sets the source_name of this TransactionSplitUpdate.

        Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name.  # noqa: E501

        :param source_name: The source_name of this TransactionSplitUpdate.  # noqa: E501
        :type: str
        """

        self._source_name = source_name

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, TransactionSplitUpdate):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
